-
Notifications
You must be signed in to change notification settings - Fork 85
fix(calm-widgets): render primitive arrays inline with comma separator list for for MDX compatibility (#2080) #2082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| {{else}} | ||
| {{this}} | ||
| {{this}}{{#unless @last}},{{/unless}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to treat this a list separated by new line, I would recommend then we build an inner list and leverage the list widget then.
<br/> has no semantic reasoning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this renders comprehensibly with comma, I'd suggest we go with it and raise a feature request is we want to add a list widget.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes an MDX compilation error that occurs when CALM architecture metadata contains arrays of primitive values. The fix ensures primitive arrays are rendered inline with comma separators instead of with newlines, preventing MDX from interpreting the content as paragraph breaks within <td> elements.
Changes:
- Modified
table-vertical.htmlto render primitive arrays inline with comma-space separators - Modified
row-template.htmlto add commas after primitive array elements - Added test fixture
metadata-primitive-arrayand E2E test for the new behavior - Updated expected outputs for existing tests to reflect comma separators
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| calm-widgets/src/widgets/table/table-vertical.html | Added inline rendering for primitive arrays with comma-space separators; contains a critical bug (using cellValue instead of this on line 20) |
| calm-widgets/src/widgets/table/row-template.html | Added comma separators for primitive arrays (preserves newlines) |
| calm-widgets/test-fixtures/table-widget/metadata-primitive-array/* | New test fixture demonstrating MDX-safe inline rendering |
| calm-widgets/src/widgets.e2e.spec.ts | New E2E test for primitive array rendering |
| cli/test_fixtures/template/expected-output/widget-tests/* | Updated expected outputs to include comma separators |
| calm-widgets/test-fixtures/combined-widgets/comprehensive-documentation/expected.md | Updated expected output to include comma separators |
| calm-plugins/vscode/package.json | Version bump (appears unrelated to this PR) |
| package-lock.json | Lock file update for VSCode plugin version |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…r for MDX compatibility (finos#2080)

Description
Fix MDX compilation error when metadata contains arrays of primitive values.
When relationships have metadata with array values (e.g.,
"operations": ["add", "subtract", "multiply", "divide"]), the generated documentation site fails to compile with:This was caused by array values being rendered with newlines inside
<td>elements, which MDX interprets as paragraph breaks.The fix renders primitive arrays inline with comma separators:
add, subtract, multiply, divideExample in #2080 now renders appropriately
Type of Change
Affected Components
calm-widgets/)calm-plugins\vsscode)cli)Testing
Added new test fixture
metadata-primitive-arrayto verify MDX-safe array rendering.Checklist